PreviousValue and Previous (fld) are equivalent functions. However, you can use PreviousValue only with Basic syntax and Previous only with Crystal syntax
fld is the name of a database field.
Value of specified field; type depends on type of that field.
PreviousValue returns the value of the previous record of the specified field.
You can use previous to identify the last record in a previous range or the last record occurring before a new range begins, or to test for duplicate values.
The following examples are applicable to Basic syntax:
If PreviousValue ({Orders Detail.Quantity}) <> 0 Then
formula = {Orders Detail.Quantity} / 2
formula = {Orders Detail.Quantity}
Tests the previous value in the {Orders Detail.Quantity} field to see if it is a zero value. If it is not, it divides the current value by two. If it is a zero value, it returns the current value itself.
If PreviousValue ({Orders.Order ID}) Mod 10 = 0 Then
formula = "Beginning of new block"
Divides orders into blocks of 10. If the previous Order ID is a multiple of 10, it flags the current value as "Beginning of new block". Otherwise, it prints "Same block".
If PreviousValue ({Customer.Customer ID}) = {Customer.Customer ID} Then
This flags repeated values in the {Customer.Customer ID} field.
Note: Using this function in a formula forces the formula to be evaluated at print time. For more information on evaluation time considerations, see Evaluation Time functions.
Seagate Software IMG Holdings, Inc. http://www.seagatesoftware.com Support services: http://support.seagatesoftware.com |